unit fmSplash;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, fmNormal, Gauges, ExtCtrls, jpeg;

type
  TfrmSplash = class(TfrmNormal)
    imgSplash: TImage;
    Timer1: TTimer;
    Gauge1: TGauge;
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmSplash: TfrmSplash;

implementation

uses uShare;

{$R *.dfm}

procedure TfrmSplash.Timer1Timer(Sender: TObject);
begin
  inherited;
  if Gauge1.Progress < 100 then
  begin
    Gauge1.Progress := Gauge1.Progress + random(20);
  end
  else
  begin
    timer1.Enabled := false;
    ModalResult := mrOK;
  end;
end;

procedure TfrmSplash.FormCreate(Sender: TObject);
var
  SplashImgFile: string;
begin
  inherited;
  SplashImgFile := AppPath + 'Splash.jpg';
  if FileExists(SplashImgFile) then
  begin
    imgSplash.Align := alClient;
    imgSplash.Picture.LoadFromFile(SplashImgFile);
    imgSplash.Stretch := True;
  end;
end;

end.
